﻿using Caliburn.Micro;
using OPSYS_Schematic.UIInfrastructure;

namespace OPSYS_Schematic.Presentation.Parts
{
    [MenuPart(BaseMenu = WorkbenchName.WindowPart)]
    public class CloseDocumentsPart : MenuPart
    {
        public CloseDocumentsPart()
            : base(WorkbenchName.CloseDocumentsPart)
        {
            Icon = "Icons.16x16.CopyIcon";
        }

        public override void Execute()
        {
            var manager = IoC.Get<IDockScreenManager>();
            manager.Documents.Apply(item => item.Close());
        }
    }
}